﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using PowerCreator.LMS.Common.Script;

//using PowerCreator.LMS.Logic.ProjectManager;
//using PowerCreator.LMS.Logic.Common;
//using PowerCreator.LMS.Logic.CourseManager;

public partial class sysadmin_CountManager_UserProjectScheduleTable : PowerCreator.LMS.Web.Base.BasePage
{
    //ManagerProjectSchedule projectScheduleManager = new ManagerProjectSchedule();
    //ManagerProjectInfo projectManager = new ManagerProjectInfo();
    //ManagerClassInfo classManager = new ManagerClassInfo();
    //ManagerCoursewareHistory coursewareHistory = new ManagerCoursewareHistory();

    protected void Page_Load(object sender, EventArgs e)
    {
        //if (!IsPostBack)
        //{
        //    BinderGVProject();            
        //    BinderClass(1); //使用第一个方案查询

        //}
    }
    private void BinderGVProject()
    {
        //DataTable dt = new DataTable();
        //string search = "";
        //dt = projectManager.Query(search);
        //ddlProject.DataSource = dt;
        //ddlProject.DataTextField = "ProjectName";
        //ddlProject.DataValueField = "ProjectID";
        //ddlProject.DataBind();
    }

    private string GetSearch()
    {
        StringBuilder sbSearch = new StringBuilder();
        sbSearch.Append("");

        return sbSearch.ToString();
    }

    private void BinderRPT(string search)
    { 
        //绑定RPT
        //DataTable dt = new DataTable();        
        //int pageSize = projectScheduleManager.GetProjectUserListCount(search);
        //dt = projectScheduleManager.GetProjectUserList(search,1,pageSize);
        
        //rptUserProjectCount.DataSource = dt;
        //rptUserProjectCount.DataBind();
    }


    protected void ddlProject_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(ddlProject.SelectedValue))
        {
            Script.Alert(Page, "msg", "没有可选择的方案!");
            return;
        }
        else
        {
            int pid = int.Parse(ddlProject.SelectedValue);
            BinderClass(pid);
        }
        
    }
    private void BinderClass(int projectid)
    {
        //string search = string.Format("ProjectID={0}",projectid.ToString());
        //DataTable dt = new DataTable();
        //dt = classManager.Query(search);
        //ddlClass.DataSource = dt;
        //ddlClass.DataTextField = "ClassName";
        //ddlClass.DataValueField = "ClassID";
        //ddlClass.DataBind();
    }
    protected void rptUserProjectCount_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item)
        { 
            //Label lblUserID = (Label)e.Item.FindControl("lblUserID");
            //if (lblUserID != null)
            //{ 
                
            //}
        }
    }

    private void BinderRPT_GV(string userid,GridView gv)
    {
        //if (!string.IsNullOrEmpty(userid))
        //{
        //    coursewareHistory.GetStudentStartDateByUser("");
        //}
    }
}
